<?php
namespace app\index\controller;
use app\index\controller\Home;
class Basic extends Home
{
    function _initialize(){
        $this->getcategory();
        $this->getrank();
    }
    //获得类别
    public function getcategory(){
        $categorys=db("blog_category")->order("id desc")->select();
        $this->assign("categorys",$categorys);
    }
    //获得点击量高的文章
    public function getrank(){
        $rank=db("blog_article")->order("count desc")->select();
        $this->assign("rank",$rank);
    }
}